// 导入获取数据接口
import { findHeadCategory } from '@/api/home'
export default {
  namespaced: true,
  state: {
    cateList: []
  },

  mutations: {
    // 更新列表
    updateCateList (state, payload) {
      state.cateList = payload
    }
  },
  actions: {
    // 获取列表
    async getCateList ({ commit }) {
      const { result } = await findHeadCategory()
      // console.log(result)
      commit('updateCateList', result)
    }
  }
}
